package cn.jiyun.exption;

import cn.jiyun.common.R;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class QjExption {

    @ExceptionHandler(NameExption.class)
    public R QjExption(NameExption e){
        return R.error(e.getMessage()+"已存在");
    }

    @ExceptionHandler(Flexption.class)
    public R QjExption(Flexption e){
        return R.error(e.getMessage()+"分类下面存在菜品");
    }


}
